$(function()
{
    $("#post_quest").click(function()
    {
        var title   = $("#title").val()
        var content = $("#content").val()
        var user    = $.cookie("user")
        var price   = $("#price").val()
        var type    = $("#task_type option:selected").val()
        var date    = $("#date").val()
        //console.log(date)
        //参数：具体需求内容 提交者 id是主键自增，移除此参数 
        $.post("api/bussiness.php",
        {
            'title'        : title,
            'content'      : content,
            'price'        : price,
            'end_time'     : date,
            'poster'       : user,
            'type'         : type,
        },function(data,status)
        {
            if(data)
            {
                console.log(data)
                var json = JSON.parse(data)
                console.log(json)
                $("#myModal .modal-body").text(json.msg)
                if(json.code == true)
                {
                    $("audio").attr("src","audio/se_old_extend.wav")
                    $("audio")[0].play()
                }
                else
                {
                    $("audio").attr("src","audio/se_error.wav")
                    $("audio")[0].play()
                }
            }
           else
           {
               console.log("后台无数据，请联系开发者！")
           }
        })
    })
})